Skip to main content

Overview

The consultation process begins with creating a request and concludes once it is fulfilled and answered by a healthcare professional.

Detailed Lifecycle Flow

  1. Creation: Initiate the consultation using apiService.createConsultation. You must provide a question, the user ID, and the preferred medium (chat, voip, video, or gsm).
  2. Socket Connection: Once created, use the Pusher service to connect to the consultation's real-time updates. This allows your app to react instantly when a doctor accepts the request.
  3. Status Monitoring: Monitor the consultation status via socket events. Common statuses include:
    • new: Request is pending.
    • checking_medical_profile: The doctor is reviewing patient data.
    • in_progress: The consultation is live.
  4. In-Progress Session:
    • Chat: Use the AltibbiChat service to manage real-time messaging.
    • VoIP/Video: Use the VideoController and VideoView to manage the call session.
  5. Completion: Once the consultation is finished, the doctor will provide a medical recommendation.
  6. Recommendation & Prescription: Retrieve the finalized Recommendation data and download the official prescription PDF using apiService.getPrescription.

We have already covered how to create a consultation; the next step is to configure the socket connection to handle real-time status transitions.